<script setup lang="ts">
import { setNavigationBarTitle } from '@tarojs/taro';
import { Check as AppNutIconCheck } from '@nutui/icons-vue-taro';
import { onMounted } from 'vue';
import { history } from '@tarojs/router';
import { getCurrentInstance, navigateBack } from '@tarojs/taro';
import { state } from './state';
const params = getCurrentInstance().router?.params as {
  templateName: string;
};
onMounted(() => {
  setNavigationBarTitle({
    title: `${params.templateName || '模版名称'}`,
  });
});

function backList() {
  //from list类型和single类型
  if (state.from.includes('list')) {
    history.go(-2);
  } else {
    navigateBack();
  }
}
</script>

<template>
  <view class="police-security-submit-success app-page--1">
    <scroll-view class="app-page__wrapper" :scroll-y="true" :lower-threshold="100">
      <view class="police-security-submit-success__header-wrapper">
        <app-nut-icon-check class="police-security-submit-success__icon" />
      </view>
      <view>提交成功!</view>
    </scroll-view>
    <view class="police-security-submit-success__footer">
      <nut-button block shape="round" type="info" @click="backList()"> 返回列表 </nut-button>
    </view>
  </view>
</template>

<style lang="scss">
@import './index.scss';
</style>
